package timing.ukulele.gateway.model;

import org.springframework.util.StringUtils;

public class PublicKeyResponse {
    private String alg;
    private String value;

    public String getAlg() {
        return alg;
    }

    public void setAlg(String alg) {
        this.alg = alg;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        if (StringUtils.hasText(value)) {
            String newValue = value.replace("-----BEGIN PUBLIC KEY-----\n", "")
                    .replace("\n-----END PUBLIC KEY-----", "");
            this.value = newValue;
            return;
        }
        this.value = "";
    }
}
